import { ref } from 'vue'
import type { Ref } from 'vue'
const safeHeight = ref(0)
/**
 * 兼容tabbar底部安全距离
 */
export default function useSafeBottom(): Ref<number> {
  // 加iphonextabbar底部安全距离
  uni.getSystemInfo({
    success: (res) => {
      if (res.safeAreaInsets) {
        safeHeight.value = res.safeAreaInsets.bottom
      }
    },
  })
  return safeHeight
}
